package com.huilian.iotbox.admin.wap.service.impl;


import com.huilian.iotbox.admin.wap.dao.RegionDao;
import com.huilian.iotbox.admin.wap.service.RegionService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.po.Region;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 謝洛涛
 * @date 2020/4/15 9:52
 */
@Service
public class RegionServiceImpl implements RegionService {
    @Resource
    private RegionDao regionDao;
    @Override
    public ServerResponse findRegionList(Region region) {
        return ServerResponse.createBySuccess(regionDao.findRegionList(region));
    }

    @Override
    public String findRegion(String Province,String city ,String district) {
        String provinceName =  regionDao.findRegion(Province);
        String cityName = regionDao.findRegion(city);
        String districtName = regionDao.findRegion(district);
        return provinceName+"_"+cityName+"_"+districtName;
    }


}
